node: Provide fallback for MachineIdentifier, in case shell is not available#357
node: Provide fallback for MachineIdentifier, in case shell is not available#357steilerDev wants to merge 1 commit intobacktrace-labs:mainfrom
Conversation
rick-bt
left a comment
There was a problem hiding this comment.
Hi @steilerDev! This would mask multiple exception types which is risky. Can't take this into main as-is. A good alt would be to not punch out to shell to get a consistent identifier, if you want to give that a try. Compose a few machine-stable identifiers and hash it to a uuid.
|
Hey @rick-bt - I fully understand your input, my proposal is a very quick and dirty "fix". However, the challenge I'm facing in my execution environment is that it's a hardened, ephemeral Docker container: No system tools or shell available, besides nodejs. Therefore any fingerprint created, would probably not survive a container restart. I do have a user identifier available - maybe the 'correct' solution would be an option to allow the dev to supply a MachineIdentifier to the lib as a configuration option? |
In a hardened environment, where shell access has been restricted, spinning up Backtrace leads to an unhandled exception:
The proposed change handles any exception thrown, to return
nulland triggering the existing fallback caseconst guid = this.generateGuid() ?? IdGenerator.uuid();